package org.test.test1.Result;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@AllArgsConstructor
public class MyResult {
    private boolean success;
    private int code;
    private String msg;
    private Object data;

    public static MyResult success(Object data){
        return new MyResult(true,200,"成功！",data);
    }

    public static MyResult fail(int code,String msg){
        return new MyResult(false,code,msg,null);
    }
}
